<#setting classic_compatible=true> <#assign
	base=request.contextPath /> <!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>统计</title>
    <script th:src="@{/jquery/jquery.min.js}"></script>
    <script src="${base}/zhgl-jzstyxx-manage/vendors/jquery/dist/jquery.min.js"></script>
	<script src="${base}/zhgl-jzstyxx-manage/js/login/jquery.cookie.js"></script>
	<script src="${base}/zhgl-jzstyxx-manage/js/login/jquery.session.js"></script>
</head>
<body>
            当前在线人数总计:<span id="sum"></span> <br>
           具体人员为：<span id="users"></span> <br>
          发送消息：请输入推送内容<input type="text" id="msg">  <br>
          请输入发送人昵称<input type="text" id="username">  <br>
   <input type="button" value="发送" onclick="sendMsg()"></input>        <br>   
   <input type="button" value="全部发送" onclick="sendAll()"></input>       
   <script type="text/javascript">
	   function sendMsg(){
		   var user = $("#username").val();
		   console.log(user);
		   var msg = $("#msg").val();
		   if(msg!=null&&msg!=""&&user!=null&&user!=""){
				$.getJSON( '/zhgl-jzstyxx-manage/sendmsg?username='+user+'&msg='+msg, function(data) {
					alert(data);
				});
		   }else{
			   alert("请填写要发送的用户昵称或者发送内容");
		   }
	   }
	   
	   function sendAll(){
		   var msg = $("#msg").val();
		   if(msg!=null&&msg!=""){
			  $.getJSON( '/zhgl-jzstyxx-manage/sendAll?msg='+msg, function(data) {
					alert(data);
			  });
		   }else{
			   alert("请填写要发送的内容");
		   }
	   }
	   
	   $("document").ready(function(){
		//页面加载完毕
		   var num="${num}";
		   var users="${users}";
		   document.getElementById('sum').innerHTML=num; 
		   document.getElementById('users').innerHTML=users; 
		});
	   
   </script>
</body>

</html>